<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\HttpServer\Router\Router;

Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');

Router::get('/favicon.ico', function () {
    return '';
});

// 示例路由
Router::addGroup('/example', function () {
    Router::get('/success', 'App\Controller\ExampleController@success');
    Router::get('/fail', 'App\Controller\ExampleController@fail');
    Router::get('/paginate', 'App\Controller\ExampleController@paginate');
    Router::get('/create', 'App\Controller\ExampleController@create');
    Router::get('/unauthorized', 'App\Controller\ExampleController@unauthorized');
    Router::get('/throw-business', 'App\Controller\ExampleController@throwBusinessException');
    Router::get('/throw-unauthorized', 'App\Controller\ExampleController@throwUnauthorizedException');
    Router::get('/throw-notfound', 'App\Controller\ExampleController@throwNotFoundException');
    Router::get('/throw-static', 'App\Controller\ExampleController@throwStatic');
    Router::get('/throw-system', 'App\Controller\ExampleController@throwSystemException');
    Router::get('/validation-error', 'App\Controller\ExampleController@validationError');
    Router::get('/user', 'App\Controller\ExampleController@getUserById');
    Router::get('/custom', 'App\Controller\ExampleController@customResponse');
    
    // 日志测试路由
    Router::get('/test-log-get', 'App\Controller\ExampleController@testLogGet');
    Router::post('/test-log-post', 'App\Controller\ExampleController@testLogPost');
    Router::get('/test-log-slow', 'App\Controller\ExampleController@testLogSlow');
    Router::get('/test-log-error', 'App\Controller\ExampleController@testLogError');
});
